using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
namespace MemoryGame
{

    public class StateHint : DEF
    {
        public static Rectangle rectF;

        public static void SendMessage(int type)
        {
            switch (type)
            {
                case MESSAGE_CTOR:
                    rectF = new Rectangle(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
                    break;

                case MESSAGE_UPDATE:
                    if (InputState.isBackKeyPress())
                    {
                        Game1.changeState(Game1.STATE_SELECT_LEVEL);
                        return;
                    }
                    if (InputState.isTouchReleaseScreen())
                        Game1.changeState(Game1.STATE_GAMEPLAY);
                    break;

                case MESSAGE_PAINT:

                    StateGameplay.SendMessage(MESSAGE_PAINT);

                    var t = new Texture2D(Game1.graphicsDevice, 1, 1);
                    t.SetData(new[] { Color.White });
                    Game1.spriteBatch.Draw(t, rectF, new Color(0, 0, 0, 220));

                    
                    if (Game1.timeCurrent % 1000 < 500)
                    {
                        string dialogText = "Touch Screen To Continue";
                        Vector2 tempMeasure = Game1.fontNormal.MeasureString(dialogText);
                        Game1.spriteBatch.DrawString(Game1.fontNormal, dialogText, new Vector2((DEF.SCREEN_WIDTH - (int)tempMeasure.X) / 2, DEF.SCREEN_HEIGHT - (int)tempMeasure.Y - 10), Color.White);
                    }
                    break;
                case MESSAGE_DTOR:
                    break;
            }
        }
    }
}
